//logs.js
const util = require('../../utils/util.js')
const app = getApp();
Page({
  data: {
    userInfo: {},
    hasUserInfo: false,
    canIUse: wx.canIUse('button.open-type.getUserInfo'),
    isAdmin: false,
    isManager: false,
    isTemporary: false,
  },

  onLoad: function () {
    if (app.globalData.userInfo) {
      this.setData({
        userInfo: app.globalData.userInfo,
        hasUserInfo: true,
      });
    }

    if (app.globalData.myUserData) {
      this.setData({
        isAdmin: app.globalData.myUserData.isAdmin,
        isManager: app.globalData.myUserData.isManager,
        isTemporary: app.globalData.myUserData.isTemporary,
      })
    }
  },

  onBasicInfo: function () {
    wx.navigateTo({
      url: '/pages/basicInfo/basicInfo',
    })
  },

  bindViewTap: function () {
    wx.navigateTo({
      url: '/pages/basicInfo/basicInfo',
    })
  },

  onLogout: function () {
    wx.showModal({
      title: '温馨提示',
      content: `是否注销当前账号？`,
      success: function (res) {
        if (res.confirm) {
          wx.clearStorage();
          wx.reLaunch({
            url: '/pages/authorization/authorization',
          })
        }
      }
    })
  },

  //我的报餐
  onMyMeal: function () {
    wx.navigateTo({
      url: '/pages/meal_my_all/meal_my_all',
    })
  },
  //报餐统计
  onMealStatistics: function () {
    wx.navigateTo({
      url: '/pages/meal_statistics_oneday/meal_statistics',
    })
  },
  //报餐统计 全部
  onMealStatisticsAll: function () {
    wx.navigateTo({
      url: '/pages/meal_statistics_all/meal_statistics_all',
    })
  },
  //报餐明细
  onMealDetailAll: function () {
    wx.navigateTo({
      url: '/pages/meal_detail_all/meal_detail_all',
    })
  },
  //报餐明细 每天
  onMealDetailOneDayAll: function () {
    wx.navigateTo({
      url: '/pages/meal_detail_oneday/meal_detail_oneday',
    })
  },
  //点菜排行
  onDishesReport: function () {
    wx.navigateTo({
      url: '/pages/dishes_report/dishes_report',
    })
  },
  //区域设置 全部
  onDistrictSet: function () {
    wx.navigateTo({
      url: '/pages/district_set/district',
    })
  },
  //区域设置 当前公司
  onDistrictCurrentSet: function () {
    wx.navigateTo({
      url: '/pages/district_current_set/district_current_set',
    })
  },
  //公司
  onCompany: function () {
    wx.navigateTo({
      url: '/pages/company/company',
    })
  },
  //食堂设置
  onDiningHallSet: function () {
    wx.navigateTo({
      url: '/pages/dininghall_set/dininghall_set',
    })
  },
  //餐点设置
  onMealTimeSet: function () {
    wx.navigateTo({
      url: '/pages/meal_set/meal_set',
    })
  },
  //添加手机号
  onAddMobile: function () {
    wx.navigateTo({
      url: '/pages/mobile_add/mobile_add',
    })
  },
  onUserInfo: function () {
    wx.navigateTo({
      url: '/pages/userInfo/userInfo',
    })
  },
  //家属报餐
  onFamilyMeal: function () {
    wx.navigateTo({
      url: '/pages/meal_family/meal_family',
    })
  },
  //临时报餐
  onInterimMeal: function () {
    wx.navigateTo({
      url: '/pages/meal_Interim/meal_Interim',
    })
  },
  //发布公告
  onAnnouncement: function () {
    wx.navigateTo({
      url: '/pages/Announcement/Announcement',
    })
  },
  //评价
  onEvaluation: function () {
    wx.navigateTo({
      url: '/pages/evaluate/evaluate',
    })
  },
  //评价项目设置
  onEvaluationContent: function () {
    wx.navigateTo({
      url: '/pages/EvaluationContent/evaluationContent',
    })
  },
  //评价报告单
  onEvaluationReport: function () {
    wx.navigateTo({
      url: '/pages/EvaluationReport/EvaluationReport',
    })
  },
  //菜品设置
  onDishesSet: function () {
    wx.navigateTo({
      url: '/pages/dishes_set/dishes_set',
    })
  },
  //菜品分类
  onDishesClassSet: function () {
    wx.navigateTo({
      url: '/pages/dishes_class/dishes_class',
    })
  },
  //属性设置
  onAttributeSet: function () {
    wx.navigateTo({
      url: '/pages/attribute/attribute',
    })
  },
  onSystemSetting: function () {
    wx.navigateTo({
      url: '/pages/system_setting/system_setting',
    })
  },
  onContact:function(){
    wx.showModal({
      confirmColor: 'confirmColor',
      showCancel: false,
      title: '联系我们',
      content: '郑剑文（13959562997）\n 莆田市启思软件有限公司',
    })
  },
})